package com.le.tester.book.concurrentchallenge.threadSafedelegation;

import com.le.tester.book.effectivejava3rdchinese.articlesixteen.Point;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * createTime：2025-03-16 17:03
 * description：线程安全委托给ConcurrentHashMap
 */
public class DelegatingVehicleTracker {
    private final ConcurrentMap<String, Point> locations;

    private final Map<String, Point> unmodifiableMap;

    public DelegatingVehicleTracker(Map<String, Point> points) {
        locations = new ConcurrentHashMap<>();
        unmodifiableMap = Collections.unmodifiableMap(locations);
    }


}
